\(\int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx\) [103]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 23 \[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {x}{a}+\frac {i \log (\cos (c+d x))}{a d} \]

[Out]

x/a+I*ln(cos(d*x+c))/a/d

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 31} \[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {x}{a}+\frac {i \log (\cos (c+d x))}{a d} \]

[In]

Int[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x]),x]

[Out]

x/a + (I*Log[Cos[c + d*x]])/(a*d)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,i a \tan (c+d x)\right )}{a d} \\ & = \frac {x}{a}+\frac {i \log (\cos (c+d x))}{a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {i \log (i-\tan (c+d x))}{a d} \]

[In]

Integrate[Sec[c + d*x]^2/(a + I*a*Tan[c + d*x]),x]

[Out]

((-I)*Log[I - Tan[c + d*x]])/(a*d)

Maple [A] (verified)

Time = 0.54 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00

method result size
derivativedivides \(-\frac {i \ln \left (a +i a \tan \left (d x +c \right )\right )}{a d}\) \(23\)
default \(-\frac {i \ln \left (a +i a \tan \left (d x +c \right )\right )}{a d}\) \(23\)
risch \(\frac {2 x}{a}+\frac {2 c}{a d}+\frac {i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{a d}\) \(38\)

[In]

int(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-I/a/d*ln(a+I*a*tan(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.13 \[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {2 \, d x + i \, \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{a d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

(2*d*x + I*log(e^(2*I*d*x + 2*I*c) + 1))/(a*d)

Sympy [F]

\[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=- \frac {i \int \frac {\sec ^{2}{\left (c + d x \right )}}{\tan {\left (c + d x \right )} - i}\, dx}{a} \]

[In]

integrate(sec(d*x+c)**2/(a+I*a*tan(d*x+c)),x)

[Out]

-I*Integral(sec(c + d*x)**2/(tan(c + d*x) - I), x)/a

Maxima [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.87 \[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {i \, \log \left (i \, a \tan \left (d x + c\right ) + a\right )}{a d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

-I*log(I*a*tan(d*x + c) + a)/(a*d)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (21) = 42\).

Time = 0.36 (sec) , antiderivative size = 57, normalized size of antiderivative = 2.48 \[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {-\frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a} + \frac {2 i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}{a} - \frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a}}{d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-(-I*log(tan(1/2*d*x + 1/2*c) + 1)/a + 2*I*log(tan(1/2*d*x + 1/2*c) - I)/a - I*log(tan(1/2*d*x + 1/2*c) - 1)/a
)/d

Mupad [B] (verification not implemented)

Time = 4.31 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83 \[ \int \frac {\sec ^2(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{a\,d} \]

[In]

int(1/(cos(c + d*x)^2*(a + a*tan(c + d*x)*1i)),x)

[Out]

-(log(tan(c + d*x) - 1i)*1i)/(a*d)